ÿØÿÛ C
| name file | size | edit | permission | action |
|---|---|---|---|---|
| .htaccess | 1444 KB | October 31 2025 08:48:41 | 0644 | |
| .htaccess.bk | 714 KB | December 05 2024 23:54:43 | 0644 | |
| .private | - | December 05 2024 23:53:49 | 0755 | |
| default.php | 16395 KB | December 05 2024 23:53:33 | 0644 | |
| index.php | 405 KB | December 05 2024 23:53:40 | 0644 | |
| license.txt | 19915 KB | October 03 2025 03:33:36 | 0644 | |
| readme.html | 7409 KB | October 03 2025 03:33:36 | 0644 | |
| wp-activate.php | 7387 KB | December 05 2024 23:53:39 | 0644 | |
| wp-admin | - | December 05 2024 23:53:40 | 0755 | |
| wp-blog-header.php | 351 KB | December 05 2024 23:53:40 | 0644 | |
| wp-comments-post.php | 2323 KB | December 05 2024 23:53:40 | 0644 | |
| wp-config-sample.php | 3336 KB | December 05 2024 23:53:40 | 0644 | |
| wp-config.php | 3531 KB | December 05 2024 23:54:43 | 0644 | |
| wp-content | - | October 31 2025 08:48:41 | 0755 | |
| wp-cron.php | 5617 KB | December 05 2024 23:53:39 | 0644 | |
| wp-includes | - | December 05 2024 23:53:40 | 0755 | |
| wp-links-opml.php | 2502 KB | December 05 2024 23:53:40 | 0644 | |
| wp-load.php | 3937 KB | December 05 2024 23:53:40 | 0644 | |
| wp-login.php | 51367 KB | December 05 2024 23:53:39 | 0644 | |
| wp-mail.php | 8543 KB | December 05 2024 23:53:40 | 0644 | |
| wp-settings.php | 29032 KB | December 05 2024 23:53:40 | 0644 | |
| wp-signup.php | 34385 KB | December 05 2024 23:53:39 | 0644 | |
| wp-trackback.php | 5102 KB | December 05 2024 23:53:39 | 0644 | |
| xmlrpc.php | 3246 KB | December 05 2024 23:53:39 | 0644 |
' . $domain . '',
'init'
),
'6.7.0'
);
}
// Themes with their language directory outside of WP_LANG_DIR have a different file name.
$template_directory = trailingslashit( get_template_directory() );
$stylesheet_directory = trailingslashit( get_stylesheet_directory() );
if ( str_starts_with( $path, $template_directory ) || str_starts_with( $path, $stylesheet_directory ) ) {
$mofile = "{$path}{$locale}.mo";
} else {
$mofile = "{$path}{$domain}-{$locale}.mo";
}
return load_textdomain( $domain, $mofile, $locale );
}
/**
* Returns the Translations instance for a text domain.
*
* If there isn't one, returns empty Translations instance.
*
* @since 2.8.0
*
* @global MO[] $l10n An array of all currently loaded text domains.
*
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @return Translations|NOOP_Translations A Translations instance.
*/
function get_translations_for_domain( $domain ) {
global $l10n;
if ( isset( $l10n[ $domain ] ) || ( _load_textdomain_just_in_time( $domain ) && isset( $l10n[ $domain ] ) ) ) {
return $l10n[ $domain ];
}
static $noop_translations = null;
if ( null === $noop_translations ) {
$noop_translations = new NOOP_Translations();
}
$l10n[ $domain ] = &$noop_translations;
return $noop_translations;
}
/**
* Determines whether there are translations for the text domain.
*
* @since 3.0.0
*
* @global MO[] $l10n An array of all currently loaded text domains.
*
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @return bool Whether there are translations.
*/
function is_textdomain_loaded( $domain ) {
global $l10n;
return isset( $l10n[ $domain ] ) && ! $l10n[ $domain ] instanceof NOOP_Translations;
}
/**
* Translates role name.
*
* Since the role names are in the database and not in the source there
* are dummy gettext calls to get them into the POT file and this function
* properly translates them back.
*
* The before_last_bar() call is needed, because older installations keep the roles
* using the old context format: 'Role name|User role' and just skipping the
* content after the last bar is easier than fixing them in the DB. New installations
* won't suffer from that problem.
*
* @since 2.8.0
* @since 5.2.0 Added the `$domain` parameter.
*
* @param string $name The role name.
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
* Default 'default'.
* @return string Translated role name on success, original name on failure.
*/
function translate_user_role( $name, $domain = 'default' ) {
return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain );
}
/**
* Gets all available languages based on the presence of *.mo and *.l10n.php files in a given directory.
*
* The default directory is WP_LANG_DIR.
*
* @since 3.0.0
* @since 4.7.0 The results are now filterable with the {@see 'get_available_languages'} filter.
* @since 6.5.0 The initial file list is now cached and also takes into account *.l10n.php files.
*
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
*
* @param string $dir A directory to search for language files.
* Default WP_LANG_DIR.
* @return string[] An array of language codes or an empty array if no languages are present.
* Language codes are formed by stripping the file extension from the language file names.
*/
function get_available_languages( $dir = null ) {
global $wp_textdomain_registry;
$languages = array();
$path = is_null( $dir ) ? WP_LANG_DIR : $dir;
$lang_files = $wp_textdomain_registry->get_language_files_from_path( $path );
if ( $lang_files ) {
foreach ( $lang_files as $lang_file ) {
$lang_file = basename( $lang_file, '.mo' );
$lang_file = basename( $lang_file, '.l10n.php' );
if ( ! str_starts_with( $lang_file, 'continents-cities' ) && ! str_starts_with( $lang_file, 'ms-' ) &&
! str_starts_with( $lang_file, 'admin-' ) ) {
$languages[] = $lang_file;
}
}
}
/**
* Filters the list of available language codes.
*
* @since 4.7.0
*
* @param string[] $languages An array of available language codes.
* @param string $dir The directory where the language files were found.
*/
return apply_filters( 'get_available_languages', array_unique( $languages ), $dir );
}
/**
* Gets installed translations.
*
* Looks in the wp-content/languages directory for translations of
* plugins or themes.
*
* @since 3.7.0
*
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
*
* @param string $type What to search for. Accepts 'plugins', 'themes', 'core'.
* @return array Array of language data.
*/
function wp_get_installed_translations( $type ) {
global $wp_textdomain_registry;
if ( 'themes' !== $type && 'plugins' !== $type && 'core' !== $type ) {
return array();
}
$dir = 'core' === $type ? WP_LANG_DIR : WP_LANG_DIR . "/$type";
if ( ! is_dir( $dir ) ) {
return array();
}
$files = $wp_textdomain_registry->get_language_files_from_path( $dir );
if ( ! $files ) {
return array();
}
$language_data = array();
foreach ( $files as $file ) {
if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?)\.(?:mo|l10n\.php)/', basename( $file ), $match ) ) {
continue;
}
list( , $textdomain, $language ) = $match;
if ( '' === $textdomain ) {
$textdomain = 'default';
}
if ( str_ends_with( $file, '.mo' ) ) {
$pofile = substr_replace( $file, '.po', - strlen( '.mo' ) );
if ( ! file_exists( $pofile ) ) {
continue;
}
$language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( $pofile );
} else {
$pofile = substr_replace( $file, '.po', - strlen( '.l10n.php' ) );
// If both a PO and a PHP file exist, prefer the PO file.
if ( file_exists( $pofile ) ) {
continue;
}
$language_data[ $textdomain ][ $language ] = wp_get_l10n_php_file_data( $file );
}
}
return $language_data;
}
/**
* Extracts headers from a PO file.
*
* @since 3.7.0
*
* @param string $po_file Path to PO file.
* @return string[] Array of PO file header values keyed by header name.
*/
function wp_get_pomo_file_data( $po_file ) {
$headers = get_file_data(
$po_file,
array(
'POT-Creation-Date' => '"POT-Creation-Date',
'PO-Revision-Date' => '"PO-Revision-Date',
'Project-Id-Version' => '"Project-Id-Version',
'X-Generator' => '"X-Generator',
)
);
foreach ( $headers as $header => $value ) {
// Remove possible contextual '\n' and closing double quote.
$headers[ $header ] = preg_replace( '~(\\\n)?"$~', '', $value );
}
return $headers;
}
/**
* Extracts headers from a PHP translation file.
*
* @since 6.6.0
*
* @param string $php_file Path to a `.l10n.php` file.
* @return string[] Array of file header values keyed by header name.
*/
function wp_get_l10n_php_file_data( $php_file ) {
$data = (array) include $php_file;
unset( $data['messages'] );
$headers = array(
'POT-Creation-Date' => 'pot-creation-date',
'PO-Revision-Date' => 'po-revision-date',
'Project-Id-Version' => 'project-id-version',
'X-Generator' => 'x-generator',
);
$result = array(
'POT-Creation-Date' => '',
'PO-Revision-Date' => '',
'Project-Id-Version' => '',
'X-Generator' => '',
);
foreach ( $headers as $po_header => $php_header ) {
if ( isset( $data[ $php_header ] ) ) {
$result[ $po_header ] = $data[ $php_header ];
}
}
return $result;
}
/**
* Displays or returns a Language selector.
*
* @since 4.0.0
* @since 4.3.0 Introduced the `echo` argument.
* @since 4.7.0 Introduced the `show_option_site_default` argument.
* @since 5.1.0 Introduced the `show_option_en_us` argument.
* @since 5.9.0 Introduced the `explicit_option_en_us` argument.
*
* @see get_available_languages()
* @see wp_get_available_translations()
*
* @param string|array $args {
* Optional. Array or string of arguments for outputting the language selector.
*
* @type string $id ID attribute of the select element. Default 'locale'.
* @type string $name Name attribute of the select element. Default 'locale'.
* @type string[] $languages List of installed languages, contain only the locales.
* Default empty array.
* @type array $translations List of available translations. Default result of
* wp_get_available_translations().
* @type string $selected Language which should be selected. Default empty.
* @type bool|int $echo Whether to echo the generated markup. Accepts 0, 1, or their
* boolean equivalents. Default 1.
* @type bool $show_available_translations Whether to show available translations. Default true.
* @type bool $show_option_site_default Whether to show an option to fall back to the site's locale. Default false.
* @type bool $show_option_en_us Whether to show an option for English (United States). Default true.
* @type bool $explicit_option_en_us Whether the English (United States) option uses an explicit value of en_US
* instead of an empty value. Default false.
* }
* @return string HTML dropdown list of languages.
*/
function wp_dropdown_languages( $args = array() ) {
$parsed_args = wp_parse_args(
$args,
array(
'id' => 'locale',
'name' => 'locale',
'languages' => array(),
'translations' => array(),
'selected' => '',
'echo' => 1,
'show_available_translations' => true,
'show_option_site_default' => false,
'show_option_en_us' => true,
'explicit_option_en_us' => false,
)
);
// Bail if no ID or no name.
if ( ! $parsed_args['id'] || ! $parsed_args['name'] ) {
return;
}
// English (United States) uses an empty string for the value attribute.
if ( 'en_US' === $parsed_args['selected'] && ! $parsed_args['explicit_option_en_us'] ) {
$parsed_args['selected'] = '';
}
$translations = $parsed_args['translations'];
if ( empty( $translations ) ) {
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
$translations = wp_get_available_translations();
}
/*
* $parsed_args['languages'] should only contain the locales. Find the locale in
* $translations to get the native name. Fall back to locale.
*/
$languages = array();
foreach ( $parsed_args['languages'] as $locale ) {
if ( isset( $translations[ $locale ] ) ) {
$translation = $translations[ $locale ];
$languages[] = array(
'language' => $translation['language'],
'native_name' => $translation['native_name'],
'lang' => current( $translation['iso'] ),
);
// Remove installed language from available translations.
unset( $translations[ $locale ] );
} else {
$languages[] = array(
'language' => $locale,
'native_name' => $locale,
'lang' => '',
);
}
}
$translations_available = ( ! empty( $translations ) && $parsed_args['show_available_translations'] );
// Holds the HTML markup.
$structure = array();
// List installed languages.
if ( $translations_available ) {
$structure[] = '';
}
// List available translations.
if ( $translations_available ) {
$structure[] = '';
}
// Combine the output string.
$output = sprintf( '';
if ( $parsed_args['echo'] ) {
echo $output;
}
return $output;
}
/**
* Determines whether the current locale is right-to-left (RTL).
*
* For more information on this and similar theme functions, check out
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
* Conditional Tags} article in the Theme Developer Handbook.
*
* @since 3.0.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @return bool Whether locale is RTL.
*/
function is_rtl() {
global $wp_locale;
if ( ! ( $wp_locale instanceof WP_Locale ) ) {
return false;
}
return $wp_locale->is_rtl();
}
/**
* Switches the translations according to the given locale.
*
* @since 4.7.0
*
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
*
* @param string $locale The locale.
* @return bool True on success, false on failure.
*/
function switch_to_locale( $locale ) {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
if ( ! $wp_locale_switcher ) {
return false;
}
return $wp_locale_switcher->switch_to_locale( $locale );
}
/**
* Switches the translations according to the given user's locale.
*
* @since 6.2.0
*
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
*
* @param int $user_id User ID.
* @return bool True on success, false on failure.
*/
function switch_to_user_locale( $user_id ) {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
if ( ! $wp_locale_switcher ) {
return false;
}
return $wp_locale_switcher->switch_to_user_locale( $user_id );
}
/**
* Restores the translations according to the previous locale.
*
* @since 4.7.0
*
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
*
* @return string|false Locale on success, false on error.
*/
function restore_previous_locale() {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
if ( ! $wp_locale_switcher ) {
return false;
}
return $wp_locale_switcher->restore_previous_locale();
}
/**
* Restores the translations according to the original locale.
*
* @since 4.7.0
*
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
*
* @return string|false Locale on success, false on error.
*/
function restore_current_locale() {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
if ( ! $wp_locale_switcher ) {
return false;
}
return $wp_locale_switcher->restore_current_locale();
}
/**
* Determines whether switch_to_locale() is in effect.
*
* @since 4.7.0
*
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
*
* @return bool True if the locale has been switched, false otherwise.
*/
function is_locale_switched() {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
return $wp_locale_switcher->is_switched();
}
/**
* Translates the provided settings value using its i18n schema.
*
* @since 5.9.0
* @access private
*
* @param string|string[]|array[]|object $i18n_schema I18n schema for the setting.
* @param string|string[]|array[] $settings Value for the settings.
* @param string $textdomain Textdomain to use with translations.
*
* @return string|string[]|array[] Translated settings.
*/
function translate_settings_using_i18n_schema( $i18n_schema, $settings, $textdomain ) {
if ( empty( $i18n_schema ) || empty( $settings ) || empty( $textdomain ) ) {
return $settings;
}
if ( is_string( $i18n_schema ) && is_string( $settings ) ) {
return translate_with_gettext_context( $settings, $i18n_schema, $textdomain );
}
if ( is_array( $i18n_schema ) && is_array( $settings ) ) {
$translated_settings = array();
foreach ( $settings as $value ) {
$translated_settings[] = translate_settings_using_i18n_schema( $i18n_schema[0], $value, $textdomain );
}
return $translated_settings;
}
if ( is_object( $i18n_schema ) && is_array( $settings ) ) {
$group_key = '*';
$translated_settings = array();
foreach ( $settings as $key => $value ) {
if ( isset( $i18n_schema->$key ) ) {
$translated_settings[ $key ] = translate_settings_using_i18n_schema( $i18n_schema->$key, $value, $textdomain );
} elseif ( isset( $i18n_schema->$group_key ) ) {
$translated_settings[ $key ] = translate_settings_using_i18n_schema( $i18n_schema->$group_key, $value, $textdomain );
} else {
$translated_settings[ $key ] = $value;
}
}
return $translated_settings;
}
return $settings;
}
/**
* Retrieves the list item separator based on the locale.
*
* @since 6.0.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @return string Locale-specific list item separator.
*/
function wp_get_list_item_separator() {
global $wp_locale;
if ( ! ( $wp_locale instanceof WP_Locale ) ) {
// Default value of WP_Locale::get_list_item_separator().
/* translators: Used between list items, there is a space after the comma. */
return __( ', ' );
}
return $wp_locale->get_list_item_separator();
}
/**
* Retrieves the word count type based on the locale.
*
* @since 6.2.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @return string Locale-specific word count type. Possible values are `characters_excluding_spaces`,
* `characters_including_spaces`, or `words`. Defaults to `words`.
*/
function wp_get_word_count_type() {
global $wp_locale;
if ( ! ( $wp_locale instanceof WP_Locale ) ) {
// Default value of WP_Locale::get_word_count_type().
return 'words';
}
return $wp_locale->get_word_count_type();
}
/**
* Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale.
*
* @since 6.7.0
*
* @param string $singular Singular translation to check.
* @param string $textdomain Optional. Text domain. Default 'default'.
* @param ?string $locale Optional. Locale. Default current locale.
* @return bool True if the translation exists, false otherwise.
*/
function has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ): bool {
return WP_Translation_Controller::get_instance()->has_translation( $singular, $textdomain, $locale );
}